package com.fsgom.gool.service;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.GenericServlet;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fsgom.common.util.EncryptUtils;
import com.fsgom.gool.bean.GoolArtclInfo;
import com.fsgom.gool.bean.GoolUserInfo;
import com.fsgom.gool.controller.GoolMainController;
import com.fsgom.gool.repository.GoolArtclRepository;
import com.fsgom.gool.repository.GoolUserInfoRepository;

@Service
public class GoolMainServiceImpl implements GoolMainService {

	private final Logger log = Logger.getLogger(GoolMainServiceImpl.class);

	@Override
	public String decString(String encString) {
		EncryptUtils encUtils = new EncryptUtils();
		String decString = null;
		try {
			decString = encUtils.decrypt(encString);
		} catch (Exception e) {
			log.error(e.getMessage());
		}
		return decString;
	}
	
	@Override
	public String encString(String plainTxt) {
		EncryptUtils encUtils = new EncryptUtils();
		String encString = null;
		try {
			encString = encUtils.encrypt(plainTxt);
		} catch (Exception e) {
			log.error(e.getMessage());
		}
		return encString;
	}

	@Override
	public GoolUserInfo getUserInfo(Integer userSeq, String userId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean isOwner(GoolUserInfo userInfo, String userId, String passWd) {
		// TODO Auto-generated method stub
		return false;
	}
	
	
}
